﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using S7.Net;
using S7.Net.Types;

namespace S7NetManager.Reader
{
    [Serializable]
    public class DataItemEntity
    {
        public int Id { get; set; }

        public VarType VarType { get; set; }

        public int DB { get; set; }

        public DataType DataType { get; set; }

        public int StartByteAdr { get; set; }

        public string Name { get; set; }

        public byte BitAdr { get; set; } = 0;

        public DataItem ToDataItem()
         => new DataItem
         {
             VarType = this.VarType,
             BitAdr = BitAdr,
             StartByteAdr = StartByteAdr,
             DataType = this.DataType,
             DB = this.DB,             
         };
    }
}
